/**
 * $Id$
 * @author mcanovas
 * @date   Mar 5, 2012 10:01:11 AM
 *
 * Copyright (C) 2012 Scytl Secure Electronic Voting SA
 *
 * All rights reserved.
 *
 */
package org.sk.gsync.ui;

import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;

public class SaveCancelButtonsPanel extends DefaultPanel {

    private static final long serialVersionUID = -8729359363444085098L;

    private JButton saveButton;

    private JButton cancelButton;

    /**
     * @see org.sk.gsync.ui.DefaultPanel#configure()
     */
    @Override
    public void configure() {
        setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
        saveButton = new JButton("Save");
        cancelButton = new JButton("Cancel");
        add(saveButton);
        add(cancelButton);
        setVisible(true);
    }

    public void addSaveAction(final ActionListener listener) {
        saveButton.addActionListener(listener);
    }

    public void addCancelAction(final ActionListener listener) {
        cancelButton.addActionListener(listener);
    }

    /**
     * @see org.sk.gsync.ui.DefaultPanel#updateContext()
     */
    @Override
    public void updateContext() {
    }

}
